package cn.practice.chat.feign;

import cn.practice.chat.lang.Result;
import cn.practice.chat.response.user.LoginUser;
import cn.practice.chat.response.user.UserPasswordResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "user-server", contextId = "userApiFeign")
public interface UserApiFeign {

    /**
     * 查询用户密码 用来做登录验证
     */
    @GetMapping("/feign/getUserDetail")
    Result<UserPasswordResult> getUserDetail(@RequestParam("username") String username);


    /**
     * 登录成功之后返回用户信息给前端
     */
    @GetMapping("/feign/getUser")
    Result<LoginUser> getUser(@RequestParam("username") String username);

}
